<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Extensions  Reference</title>
    <link rel="stylesheet" type="text/css" href="css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="css/highlight.css" />
    <meta charset="utf-8">
    <script src="js/jquery.min.js" defer></script>
    <script src="js/jazzy.js" defer></script>
    
    <script src="js/lunr.min.js" defer></script>
    <script src="js/typeahead.jquery.js" defer></script>
    <script src="js/jazzy.search.js" defer></script>
  </head>
  <body>

    <a name="//apple_ref/swift/Section/Extensions" class="dashAnchor"></a>

    <a title="Extensions  Reference"></a>

    <header class="header">
      <p class="header-col header-col--primary">
        <a class="header-link" href="index.html">
          SwiftSVG Docs
        </a>
         (81% documented)
      </p>
    
      <p class="header-col--secondary">
        <form role="search" action="search.json">
          <input type="text" placeholder="Search documentation" data-typeahead>
        </form>
      </p>
    
        <p class="header-col header-col--secondary">
          <a class="header-link" href="https://github.com/mchoe/swiftsvg">
            <img class="header-icon" src="img/gh.png"/>
            View on GitHub
          </a>
        </p>
    
    </header>

    <p class="breadcrumbs">
      <a class="breadcrumb" href="index.html">SwiftSVG Reference</a>
      <img class="carat" src="img/carat.png" />
      Extensions  Reference
    </p>

    <div class="content-wrapper">
      <nav class="navigation">
        <ul class="nav-groups">
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="Classes.html">Classes</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/NSXMLSVGParser.html">NSXMLSVGParser</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/NSXMLSVGParser.html#/s:8SwiftSVG14NSXMLSVGParserC14SVGParserErrorO">– SVGParserError</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/SVGCache.html">SVGCache</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/SVGCircle.html">SVGCircle</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/SVGEllipse.html">SVGEllipse</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/SVGGroup.html">SVGGroup</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/SVGLayer.html">SVGLayer</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/SVGLine.html">SVGLine</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/SVGPath.html">SVGPath</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/SVGRectangle.html">SVGRectangle</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/SVGView.html">SVGView</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="Enums.html">Enumerations</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Enums.html#/s:8SwiftSVG7LineCapO">LineCap</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Enums.html#/s:8SwiftSVG8LineJoinO">LineJoin</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="Extensions.html">Extensions</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Extensions/BinaryFloatingPoint.html">BinaryFloatingPoint</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Extensions/CALayer.html">CALayer</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Extensions/CAShapeLayer.html">CAShapeLayer</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Extensions/CGFloat.html">CGFloat</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Extensions/Dictionary.html">Dictionary</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Extensions/DispatchQueue.html">DispatchQueue</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Extensions/Double.html">Double</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Extensions/Float.html">Float</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Extensions/FloatingPoint.html">FloatingPoint</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Extensions/String.html">String</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="Protocols.html">Protocols</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Protocols/CanManageAsychronousParsing.html">CanManageAsychronousParsing</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Protocols/DelaysApplyingAttributes.html">DelaysApplyingAttributes</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Protocols/Fillable.html">Fillable</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Protocols/ParsesAsynchronously.html">ParsesAsynchronously</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Protocols/PathCommand.html">PathCommand</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Protocols/PreviousCommand.html">PreviousCommand</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Protocols/SVGContainerElement.html">SVGContainerElement</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Protocols/SVGElement.html">SVGElement</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Protocols/SVGLayerType.html">SVGLayerType</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Protocols/SVGParser.html">SVGParser</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Protocols/SVGShapeElement.html">SVGShapeElement</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Protocols/StackType.html">StackType</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Protocols/Strokable.html">Strokable</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Protocols/Stylable.html">Stylable</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Protocols/Transformable.html">Transformable</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="Structs.html">Structures</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/ClosePath.html">ClosePath</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/CoordinateLexer.html">CoordinateLexer</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/CurveTo.html">CurveTo</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs.html#/s:8SwiftSVG13EllipticalArcV">EllipticalArc</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/HorizontalLineTo.html">HorizontalLineTo</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/LineTo.html">LineTo</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/MoveTo.html">MoveTo</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/NamedColors.html">NamedColors</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/PathDConstants.html">PathDConstants</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/PathDConstants.html#/s:8SwiftSVG14PathDConstantsV10DCharacterO">– DCharacter</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/PathDLexer.html">PathDLexer</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/QuadraticCurveTo.html">QuadraticCurveTo</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/SVGParserSupportedElements.html">SVGParserSupportedElements</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/SVGPolygon.html">SVGPolygon</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/SVGPolyline.html">SVGPolyline</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/SVGRootElement.html">SVGRootElement</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/SmoothCurveTo.html">SmoothCurveTo</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/SmoothQuadraticCurveTo.html">SmoothQuadraticCurveTo</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs.html#/s:8SwiftSVG5StackV">Stack</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs.html#/s:8SwiftSVG9TransformV">Transform</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/VerticalLineTo.html">VerticalLineTo</a>
              </li>
            </ul>
          </li>
        </ul>
      </nav>
      <article class="main-content">

        <section class="section">
          <div class="section-content">
            <h1>Extensions</h1>
            <p>The following extensions are available globally.</p>

          </div>
        </section>

        <section class="section">
          <div class="section-content">
            <div class="task-group">
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/c:objc(cs)CALayer"></a>
                    <a name="//apple_ref/swift/Extension/CALayer" class="dashAnchor"></a>
                    <a class="token" href="#/c:objc(cs)CALayer">CALayer</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>A set of convenience initializers that create new <code>CALayer</code> instances from SVG data.</p>

<p>If you choose to use these initializers, it is assumed that you would like to exercise a higher level of control. As such, you must provide a completion block and then add the passed <code><a href="Classes/SVGLayer.html">SVGLayer</a></code> to the layer of your choosing. Use the UIView extensions if you prefer the easier to use one-liner initializers.</p>

                        <a href="Extensions/CALayer.html" class="slightly-smaller">See more</a>
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">class</span> <span class="kt">CALayer</span> <span class="p">:</span> <span class="kt">NSObject</span><span class="p">,</span> <span class="kt">NSSecureCoding</span><span class="p">,</span> <span class="kt">CAMediaTiming</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/c:objc(cs)CALayer"></a>
                    <a name="//apple_ref/swift/Extension/CAShapeLayer" class="dashAnchor"></a>
                    <a class="token" href="#/c:objc(cs)CALayer">CAShapeLayer</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        
                        <a href="Extensions/CAShapeLayer.html" class="slightly-smaller">See more</a>
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">class</span> <span class="kt">CAShapeLayer</span> <span class="p">:</span> <span class="kt">CALayer</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:SB"></a>
                    <a name="//apple_ref/swift/Extension/BinaryFloatingPoint" class="dashAnchor"></a>
                    <a class="token" href="#/s:SB">BinaryFloatingPoint</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Extension that takes a length string, e.g. <code>100px</code>, <code>20mm</code> and parses it into a <code>BinaryFloatingPoint</code> (e.g. <code>Float</code>, <code>Double</code>, <code>CGFloat</code>)</p>

                        <a href="Extensions/BinaryFloatingPoint.html" class="slightly-smaller">See more</a>
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">protocol</span> <span class="kt">BinaryFloatingPoint</span> <span class="p">:</span> <span class="kt">ExpressibleByFloatLiteral</span><span class="p">,</span> <span class="kt">FloatingPoint</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:SD"></a>
                    <a name="//apple_ref/swift/Extension/Dictionary" class="dashAnchor"></a>
                    <a class="token" href="#/s:SD">Dictionary</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>An extension that add the elements of one dictionary to another</p>

                        <a href="Extensions/Dictionary.html" class="slightly-smaller">See more</a>
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">struct</span> <span class="kt">Dictionary</span><span class="o">&lt;</span><span class="kt">Key</span><span class="p">,</span> <span class="kt">Value</span><span class="o">&gt;</span> <span class="k">where</span> <span class="kt">Key</span> <span class="p">:</span> <span class="kt">Hashable</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/c:objc(cs)OS_dispatch_queue"></a>
                    <a name="//apple_ref/swift/Extension/DispatchQueue" class="dashAnchor"></a>
                    <a class="token" href="#/c:objc(cs)OS_dispatch_queue">DispatchQueue</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        
                        <a href="Extensions/DispatchQueue.html" class="slightly-smaller">See more</a>
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">class</span> <span class="kt">DispatchQueue</span> <span class="p">:</span> <span class="kt">DispatchObject</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:SF"></a>
                    <a name="//apple_ref/swift/Extension/FloatingPoint" class="dashAnchor"></a>
                    <a class="token" href="#/s:SF">FloatingPoint</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Extension that converts a <code>FloatingPoint</code> to and from radians and degrees</p>

                        <a href="Extensions/FloatingPoint.html" class="slightly-smaller">See more</a>
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">protocol</span> <span class="kt">FloatingPoint</span> <span class="p">:</span> <span class="kt">Hashable</span><span class="p">,</span> <span class="kt">SignedNumeric</span><span class="p">,</span> <span class="kt">Strideable</span> <span class="k">where</span> <span class="k">Self</span> <span class="o">==</span> <span class="k">Self</span><span class="o">.</span><span class="kt">Magnitude</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:12CoreGraphics7CGFloatV"></a>
                    <a name="//apple_ref/swift/Extension/CGFloat" class="dashAnchor"></a>
                    <a class="token" href="#/s:12CoreGraphics7CGFloatV">CGFloat</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        
                        <a href="Extensions/CGFloat.html" class="slightly-smaller">See more</a>
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">struct</span> <span class="kt">CGFloat</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:Sf"></a>
                    <a name="//apple_ref/swift/Extension/Float" class="dashAnchor"></a>
                    <a class="token" href="#/s:Sf">Float</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        
                        <a href="Extensions/Float.html" class="slightly-smaller">See more</a>
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">struct</span> <span class="kt">Float</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:Sd"></a>
                    <a name="//apple_ref/swift/Extension/Double" class="dashAnchor"></a>
                    <a class="token" href="#/s:Sd">Double</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        
                        <a href="Extensions/Double.html" class="slightly-smaller">See more</a>
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">struct</span> <span class="kt">Double</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:SS"></a>
                    <a name="//apple_ref/swift/Extension/String" class="dashAnchor"></a>
                    <a class="token" href="#/s:SS">String</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        
                        <a href="Extensions/String.html" class="slightly-smaller">See more</a>
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">struct</span> <span class="kt">String</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
          </div>
        </section>

      </article>
    </div>
    <section class="footer">
      <p>© 2017 Michael Choe under <a class="link" href="https://github.com/mchoe/SwiftSVG/blob/master/LICENSE" target="_blank" rel="external">MIT</a>.</p>
      <p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.2</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
    </section>
  </body>
</div>
</html>
